{{ define "main" }}
<div class="container-main container-list">
    <div class="toc">
        {{- partial "partials/_page-operation.html" . -}}

        <div class="list post-list">
            {{ if ne .Kind "taxonomy"}} 
            <div class="count">文章列表： {{ len .Pages }} 篇</div>
            {{else}}
            <div class="count">标签列表： {{ len .Pages }} 枚</div>
            {{ end }}
            
            <!-- {{ range .Paginator.Pages.ByTitle }} -->
            <!-- {{ end }} -->
                <div class="wrapper-item">
                {{ range .Paginator.Pages }}
                    {{if and .Title (ne .Title "<% tp.file.title %>") (ne .Title "Secrets") }}
                    <!-- 📄 ➣ 📂 -->
                    <div class="{{with .IsPage}}item{{ else }}item-term{{end}}" >
                    
                        <!-- if eq .Kind "page" -->
                        <!-- 点击右侧列表项不再直接跳转对应文章页，而是滚动列表页到相应的锚点 -->
                        <!-- <a href="{{.Permalink}}"> -->
                        <a href="#{{.Title}}">
                            <span>{{ with .IsPage}} <img src="/imgs/icons/post-3.svg" width="16" /> {{else}} <img src="/imgs/icons/ctg.svg" width="16" /> {{end}}</span>
                            <span> {{.Title}} <sup>{{if not .IsPage}}{{len .Pages}}{{ end }}</sup></span>
                        </a>
                    </div>
                    {{ end }}
                {{ end }}
                </div>
            </div>
    </div>

    <div class="content">
        {{ .Content }}
    </div>

    {{ if ne .Kind "taxonomy"}} 
        <!-- <div class="count">共有 {{ len .Pages }} 篇文章</div> -->
    {{ end }}

    <div class="list list-single-col {{if eq .Kind "taxonomy"}}list-taxonomy{{end}}">
    {{ range .Paginator.Pages }}
        {{if and .Title (ne .Title "Secrets") (ne .Title "<% tp.file.title %>")}}
        <!-- 📄 ➣ 📂 -->
        <div class="{{with .IsPage}}item{{ else }}item-term{{end}}" >
            {{if .IsPage}}<div class="c-date">{{ .Date.Format "2006-01-02" }}</div>{{end}}

            <!-- if eq .Kind "page" -->
            <a href="{{.Permalink}}" name="{{.Title}}">
                <span>{{ with .IsPage}} <img src="/imgs/icons/post-3.svg" width="16" /> {{else}} <img src="/imgs/icons/ctg.svg" width="16" /> {{end}}</span>
                <span> {{.Title}} <sup>{{if not .IsPage}}{{len .Pages}}{{ end }}</sup></span>
            </a>

            {{if .IsPage}}
            <div class="desc">
                <span class="date">
                    <!-- 更新： -->
                    <!-- <svg t="1656737270708" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="23838" width="11" height="11"><path d="M824.264 95.36c0-23.859 25.043-44.16 48.902-44.16s49.714 20.301 49.714 44.16v190.08c0 23.859-19.054 52.868-42.913 52.868h-190.08c-23.859 0-46.696-25.96-46.696-49.819s22.55-46.249 46.409-46.249h82.025C702.344 175.534 610.22 155.853 512 155.853c-206.775 0-360.398 149.372-360.398 356.147 0 206.775 153.623 358.23 360.398 358.23 206.775 0 357.467-151.455 357.467-358.23 0-23.859 23.634-50.706 53.413-50.706 29.78 0 49.92 26.847 49.92 50.706 0 254.493-206.307 460.8-460.8 460.8-254.493 0-460.8-206.307-460.8-460.8C51.2 257.507 257.507 51.2 512 51.2c122.4 0 226.684 33.296 312.264 117.369 0.358 0.351 0.358-24.052 0-73.209z" p-id="23839" fill="#adb5bd"></path></svg> -->
                    {{ .Date.Format "2006-01-02" }} ~ {{ .Lastmod.Format "2006-01-02" }}
                </span>
            </div>
            {{end}}
            
            {{ if .IsPage }}
                {{- partial "partials/_ctgtag.html" . -}}
                <div class="summary">{{ .Summary | markdownify  }}</div>
				{{ if .Truncated }}
				<!-- This <div> includes a read more link, but only if the summary is truncated... -->
				<div class="read-more">
                    <!-- 查看更多… ◿ «« -->
				  <a href="{{ .RelPermalink }}">····</a>
				</div>
				{{ end }}
            {{ end }}

        </div>
        {{ end }}
    {{ end }}
    </div>

    <div class="container-pagination">
    {{ template "_internal/pagination.html" . }}
    </div>
</div>
{{ end }}
